home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / std / c / 94 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  823 b 

  1. Path: info.uah.edu!oreo!gbacon
  2. From: gbacon@oreo (Greg Bacon)
  3. Newsgroups: comp.std.c
  4. Subject: Re: Help, best way to compare doubles
  5. Date: 13 Jan 1996 15:11:52 GMT
  6. Organization: The University of Alabama in Huntsville
  7. Message-ID: <4d8i3o$pjb@info.uah.edu>
  8. References: <4d1k09$aqq@mercury.IntNet.net>
  9. NNTP-Posting-Host: oreo.aspire.cs.uah.edu
  10. X-Newsreader: TIN [version 1.2 PL2]
  11.  
  12. Jeff Tomich (jtomich@IntNet.net) wrote:
  13. : Having a hard time to figure out a function on how to compare doubles. 
  14. : Any ideas?
  15.  
  16. : thanks, Jeff
  17.  
  18. No function necessary.. C has this really cool boolean equality operator
  19. that does this sort of thing for you.  Have a look:
  20.  
  21. {
  22. double a, b;
  23.  
  24. if (a == b) {
  25.    /* you know what to do */
  26.    }
  27.  
  28. Greg
  29. --
  30. Greg Bacon <gbacon@cs.uah.edu>
  31. University of Alabama in Huntsville
  32. CS Department Systems Support Team
  33.